package com.yueya.auth.realm;

import java.io.Serializable;
import java.util.Set;

public class Principal implements Serializable {
    private static final long serialVersionUID = -980255633986282908L;
    private String id; // 用户标识码
    private String userName; // 登录名
    private String name; // 姓名
    private Set<String> roles;
    private Set<String> permissions;
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public Principal(String id, String userName) {
        this.id = id;
        this.userName = userName;
    }
    public Principal(String id, String userName,Set<String> roles, Set<String> permissions) {
        this.id = id;
        this.userName = userName;
        this.permissions = permissions;
        this.roles = roles;
    }

    public Set<String> getRoles() {
        return roles;
    }

    public void setRoles(Set<String> roles) {
        this.roles = roles;
    }

    public Set<String> getPermissions() {
        return permissions;
    }

    public void setPermissions(Set<String> permissions) {
        this.permissions = permissions;
    }
}
